﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Cinemax.DAO;

namespace Cinemax
{
    public partial class Register : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnRegistry_Click(object sender, EventArgs e)
        {
            string user = username.Text.Trim();
            string pass = password.Text.Trim();
            string nam = name.Text.Trim();
            string mail = email.Text.Trim();
            string ad = address.Text.Trim();
            string phonenumber = phone.Text.Trim();
            TaiKhoanDAO.Register(user, pass, nam, ad, mail, phonenumber);
            int id = TaiKhoanDAO.CheckLogin(user, pass);
            Session["user_login"] = id;
            Response.Redirect("personalize.aspx");
        }
    }
}